package com.adou.p2p.domain.entiry;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Entity
@Table(name="user")
@Getter
@Setter
@NoArgsConstructor
public class User {

	@Builder
	public User(Long id, String username, String password){
		this.id = id;
		this.username = username;
		this.password = password;
	}
	
	@Id
	@Column(name = "id", unique = true, nullable = false, updatable = false)
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	@Column(name = "username", length = 255, nullable = false)
	@NotNull
	@Size(max = 255)
	private String username;
	
	@Column(name = "password", nullable = true)
	private String password;
}
